<template>
	<div class="myContent">
        <!--头部-->
		<my-header :title="dataList.inspectTitle" :hasTitle="true" :hasBack="true" ></my-header>
		<!--<div style="height:2rem;"></div>-->
		<div class="centent" style="flex:1;overflow-y:auto;">
			<!--商品列表-->
			<div class="aui-content" >
				<ul class="aui-list aui-media-list commodity_list subtotal_list">
					<li class="aui-list-item baoguo-list-item baoguo-root" style="padding-right: 0.75rem;">
						<div  class="title">
							<div>
								<span>检测人：{{dataList.inspectMan}}</span>
							</div>
							<div >
								<span>检测时间：{{getTime(dataList.inspectTm)}}</span>
								<span class="jieguo">检测结果：{{dataList.inspectResult}}</span>
							</div>
						</div>
					</li>
					<li class="aui-list-item baoguo-list-item baoguo-root noBorder" style="padding-right: 0.75rem;">
						 <!--v-html="dataList.memo"-->
						<div  class="title" v-html="dataList.inspectDetail">
							
						</div>
						
					</li>
				</ul>
			</div>
			<!--商品列表 end-->
		</div>
	</div>

</template>

<script>

import {mapGetters,mapMutations} from "vuex";
import Header from "../header";
	export default {
	  	name: 'hello',
	  	data () {
	    	return {
				dataList:null
			}
		},
		computed: {
			
			pageTree () {
				return getPageTree(this, this.page);
			}
		},
		components: {
	       "my-header": Header
	    },
	    methods: {
	    	goBack(){
	    		let  num = this.$route.query.num;
	    		this.$router.push({path:'foodChecked',query:{num:num}});
	    	},
	    	initDate(){
	    		this.dataList = this.$route.query.item;
	    		console.log(this.dataList)
	    	},
	    	//转换时间格式
			getTime(param){

				if(param){
				  	  let date = new Date(param);
					  let year = date.getFullYear();
					  let month = checkTime(date.getMonth() + 1);
					  let day = checkTime(date.getDate());
					  let hour = checkTime(date.getHours());
					  let min = checkTime(date.getMinutes());
					  let sec = checkTime(date.getSeconds());
	
					function checkTime(i) {
					    if (i < 10) {
					      i = '0' + i;
					    }
					    return i;
					  }
	
					  return month+ ' ' + '-' + ' ' + day + ' ' + hour + ' ' + ":" + ' ' + min;
			    }else{
			   	  return '';
			    }
			}
			,
	    },
		created () {
			this.initDate();
		},
		mounted () {
			// initDomTree(this.getDomTree[this.page]);
			
		},
		updated() {
			//页面更新完毕
			// initDomTree(this.getDomTree[this.page]);
		}
	}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
	.aui-searchbar, .aui-bar-nav {
		position: static;
	    left: 0;
	    top: 0;
	    z-index: 12;
	}

	.title{
		text-align: left;
		padding-top: 1rem;
		padding-bottom: 0.5rem;
		min-height: 3rem;
	}
	.title span{
		font-size: 0.8rem;
	}
	.jieguo{
		margin-left: 0.5rem;
	}
	.baoguo-root{
		border-bottom: 1px solid #eaeaea;
	}
	.noBorder{
		border-bottom:0;
	}
	.myContent{
		width: 100%;
	    height: 100%;
	    display: flex;
	    flex-direction: column;
	    justify-content: space-between;
	}
</style>